home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d3 / rettig.arc / TRSOURCE.EXE / COUNTRY.PRG < prev    next >
Text File  |  1990-10-22  |  3KB  |  103 lines

  1. *********
  2. *  COUNTRY.PRG
  3. *
  4. *  by Ralph Davis
  5. *  modified by Tom Rettig
  6. *
  7. * Placed in the public domain by Tom Rettig Associates, 10/22/1990.
  8. *
  9. *  Demonstrates use of DOSFUNC procedure.
  10. *********
  11.  
  12. CLEAR
  13. m_buff = ALLOCATE(1000)
  14. m_seg  = SUBSTR(m_buff,1,4)
  15. m_off  = SUBSTR(m_buff,5,4)
  16.  
  17. FOR i = 0 TO 254
  18.    @ 0, 0 SAY i
  19.    m_ax = '38' + SUBSTR(HEX(i),3,2)
  20.    m_bx = '0000'
  21.    m_cx = '0000'
  22.    m_dx = m_off
  23.    m_si = '0000'
  24.    m_di = '0000'
  25.    m_ds = m_seg
  26.    m_es = '0000'
  27.    m_regs = m_ax + m_bx + m_cx + m_dx + m_si + m_di + m_ds + m_es
  28.    m_flags = 0
  29.  
  30.    CALL dosfunc WITH m_regs, m_flags
  31.  
  32.    IF m_flags % 2 == 0
  33.       ?
  34.       ? "COUNTRY NO:  " + LTRIM(STR(i))
  35.       m_date = PEEKINT(m_seg,m_off)
  36.       DO CASE
  37.          CASE m_date == 0
  38.             ? "Date format:  USA (mm/dd/yy)"
  39.          CASE m_date == 1
  40.             ? "Date format:  European (dd/mm/yy)"
  41.          CASE m_date == 2
  42.             ? "Date format:  Japanese (yy/mm/dd)"
  43.       ENDCASE
  44.  
  45.       m_curr = PEEKSTR(m_seg,DEC(m_off)+2)
  46.       ? "Currency symbol:       " + m_curr
  47.       m_thou = PEEKSTR(m_seg,DEC(m_off)+7)
  48.       ? "Thousands separator:   " + m_thou
  49.       m_dec = PEEKSTR(m_seg,DEC(m_off)+9)
  50.       ? "Decimal separator:     " + m_dec
  51.       m_datesep = PEEKSTR(m_seg,DEC(m_off)+11)
  52.       ? "Date separator:        " + m_datesep
  53.       m_timesep = PEEKSTR(m_seg,DEC(m_off)+13)
  54.       ? "Time separator:        " + m_timesep
  55.       m_currform = PEEKINT(m_seg,DEC(m_off)+15)
  56.  
  57.       IF m_currform % 2 == 0
  58.          ? "Currency symbol precedes the value"
  59.       ELSE
  60.          ? "Currency symbol follows the value"
  61.       ENDIF
  62.  
  63.       m_spaces = INT((m_currform/2)) % 2
  64.       ? "There are " + LTRIM(STR(m_spaces,1,0)) + " spaces " +;
  65.         "between the value and the symbol"
  66.  
  67.       m_sign = PEEKINT(m_seg,DEC(m_off)+16)
  68.       ? "Significant decimal digits in currency:  " + LTRIM(STR(m_sign))
  69.  
  70.       m_timeform = PEEKINT(m_seg,DEC(m_off)+17)
  71.       IF m_timeform % 2 == 0
  72.         ? "Twelve hour clock in use"
  73.       ELSE
  74.         ? "Twenty-four hour clock in use"
  75.       ENDIF
  76.  
  77.       m_caseoff = HEX(PEEKINT(m_seg,DEC(m_off)+18))
  78.       m_caseseg = HEX(PEEKINT(m_seg,DEC(m_off)+20))
  79.       ? "Case map call address:  " + m_caseseg + ":" + m_caseoff
  80.       m_datasep = PEEKSTR(m_seg,DEC(m_off)+22)
  81.       ? "Data list separator:   " + m_datasep
  82.       ?
  83.       ?
  84.       ? "Press any key to continue, <Esc> to abort..."
  85.  
  86.       IF INKEY(60) == 27         && Escape key aborts
  87.          RETURN
  88.       ENDIF
  89.  
  90.       CLEAR
  91.    ENDIF
  92. NEXT
  93.  
  94. IF .NOT. DEALLOC(m_buff,1000)
  95.    ?? CHR(7)
  96.    ? 'Error freeing memory'
  97. ENDIF
  98.  
  99. CLEAR
  100. RETURN
  101. * eof: country.prg
  102.  
  103.